import Cookies from 'js-cookie'

const TokenKey = 'hrsaas-ihrm-token' // 设定一个独一无二的key
const TimenKey = 'hrsaas-timestamp-key' // 设置一个独一无二的key

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

// 获取登录成功存入的时间戳
export function getTimeStamp() {
  return Cookies.get(TimenKey)
}

// 设置登录成功的时间戳
export function setTimeStamp() {
  return Cookies.set(TimenKey, new Date().getTime())
}
